<?php
session_start();
/**
 * @author HIENDV
 * @copyright 2012
 */
include_once '../../../Model/Account.php';
$user = $_SESSION['username'];
$pass = $_REQUEST['password'];
$acc = new Account($user,$pass);
$result=$acc->update_pass();
if($result!='0'){
	$file='../../../../log/debug/'.date("y-m-d").'.txt';
	$f=fopen($file,'a+');
	if($f){
		fwrite($f,"ACCOUNT_EDIT_PASSWORD_SUCCESS: ".$user." ".gmdate('Y-m-d H:i:s')."\r");
	}
}
else {
	$file='../../../../log/error/'.date("y-m-d").'.txt';
	$f=fopen($file,'a+');
	if($f){
		fwrite($f,"ACCOUNT_EDIT_PASSWORD_ERROR: ".$user." ".gmdate('Y-m-d H:i:s')."\r");
	}

}
echo $result;       
?>